#include <stdio.h>
#include <stdlib.h>

int rnd(int limit)
{
	return rand()%limit;
}


void swap(int A[], int i, int j)
{
	int c = A[i];
	A[i] = A[j];
	A[j] = c;
}


void main()
{
	int a, n;
	int arr[500];
	int i;

	printf("Vvedite n<=500(kolichestvo elementov v massiv) N= ");
	scanf("%d",&n);
	for( i = 0; i < n; i++ )
	{
		arr[i] = rand();
		printf ("%d ", arr[i]);
	}

	printf ("\n\n");
	for (i = 0; i<n; i++ )
	{
		swap(arr, i, rnd(n));
	}
	for (i = 0; i<n; i++ )
	{
		printf ("%d ", arr[i]);
	}
	system("PAUSE");
}